Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texinfo: fix build references when cross-compiling #178352

Merged
merged 2 commits into from
Jun 23, 2022

Conversation

lopsided98
Copy link
Contributor

@lopsided98 lopsided98 commented Jun 20, 2022

Description of changes

The XS modules were being built for the build platform, and the perl scripts had build platform shebangs.

It is possible to build the XS modules by passing PERL_EXT_CC=${stdenv.cc.targetPrefix}cc --enable-perl-xs=yes, but they
fail to load due to a handshake key mismatch. Instead, I just decided to disable the XS modules and use the pure Perl fallbacks when cross-compiling.

The shebangs were fixed manually using substituteInPlace.

I also discovered that gpm was unintentionally relying on the incorrect shebangs, so I fixed that as well.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • armv7l-linux (cross)
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

The XS modules were being built for the build platform, and the perl scripts
had build platform shebangs.

It is possible to build the XS modules by passing
PERL_EXT_CC=${stdenv.cc.targetPrefix}cc and --enable-perl-xs=yes, but they
fail to load due to a handshake key mismatch. Instead, I just decided to
disable the XS modules and use the pure Perl fallbacks when cross-compiling.

The shebangs were fixed manually using substituteInPlace.
texinfo is a nativeBuildInput, but it is overridden in all-packages.nix,
which breaks splicing. Therefore, buildPackages.texinfo needs to be used
explicitly in the override.

This wasn't actually causing any problems because texinfo's scripts were using
build platform Perl shebangs. Once texinfo was fixed, gpm started failing to
cross-compile.
@lopsided98
Copy link
Contributor Author

@ofborg build pkgsCross.armv7l-hf-multiplatform.texinfoInteractive

@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jun 21, 2022
@@ -23224,7 +23224,7 @@ with pkgs;

# latest 6.8 mysteriously fails to parse '@headings single':
# https://lists.gnu.org/archive/html/bug-texinfo/2021-09/msg00011.html
texinfo = texinfo6_7;
texinfo = buildPackages.texinfo6_7;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this is needed. gpm seems to put texinfo into nativeBuildInputs. I would expect it to be enough.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 23, 2022
@lovesegfault lovesegfault merged commit 78fa690 into NixOS:staging Jun 23, 2022
@lopsided98 lopsided98 deleted the texinfo-build-ref branch June 23, 2022 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants